package com.bjsxt.chapter7_bridge;

/**
 * @ClassName Computer2
 * @Description 电脑类型维度
 * @Author 黑马程序员
 * @Date 18:50 2024/6/21
 * @Version 1.0
 **/
public class Computer2 {

    // 依赖品牌维度
    protected Brand brand;

    public Computer2(Brand brand) {
        this.brand = brand;
    }

    public void sale(){
        brand.sale();
    }

}

class DeskTop2 extends Computer2 {

    public DeskTop2(Brand brand) {
        super(brand);
    }

    public void sale (){
        super.sale();
        System.out.println("销售台式机");
    }
}

class LapTop2 extends Computer2 {

    public LapTop2(Brand brand) {
        super(brand);
    }

    public void sale (){
        super.sale();
        System.out.println("销售笔记本电脑");
    }
}

class Pad2 extends Computer2 {

    public Pad2(Brand brand) {
        super(brand);
    }

    public void sale (){
        super.sale();
        System.out.println("销售平板电脑");
    }
}
